<table id="chambers" class="admingrid">
</table>
<div id="chambers_pager"></div>
<br>
<button onclick="addChamber()">Add chamber</button>
<button onclick="removeChambers()">Remove selected chambers</button>

<script>
grids.chambers  = {
    url : generateServiceUrl({
        admin : true,
        service : "getchambers",
        page : "group_members"
    }),
    colNames : [
        "Chamber name",
        "Contact person",
        "Email"
    ],
    colModel : [
        { name : "chamber_name",    index : "chamber_name",     width : 300 },
        { name : "contact_person",  index : "contact_person",   width : 170 },
        { name : "email",           index : "email",            width : 150 }
    ],
    caption : "Chambers list",
    multiselect : true,
    multiboxonly : true,
    height : 320
};

function addChamber() {
    openAdminPopup("group_members", "add", {
        title : "Adding chamber"
    }, {
        membertype : "chambers"
    });
}

function removeChambers() {
    if (confirm("Are you sure to want to delete selected chambers?")) {
        var selectedItems = getSelectedRows("chambers");
        callAdminService("group_members", "delete", {
            ids : selectedItems
        }, {
            success : function(result) {
                refreshGrid("chambers");
            }
        });
    }
}

</script>
